<?php
import( 'de.ceus-media.framework.krypton.core.DefinitionView' );
/**
 *	Log out View.
 *	@package		mv2.view.authentication
 *	@extends		CMF_Krypton_Core_DefinitionView
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			23.04.2007
 *	@version		0.1
 */
/**
 *	Log out View.
 *	@package		mv2.view.authentication
 *	@extends		CMF_Krypton_Core_DefinitionView
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			23.04.2007
 *	@version		0.1
 */
class View_Authentication_Logout extends CMF_Krypton_Core_DefinitionView
{
	/**
	 *	Builds Views.
	 *	@access		public
	 *	@return		string
	 */
	public function buildContent()
	{
		$auth		= $this->registry->get( 'auth' );
		if( $auth->isAuthenticated() )
		{
			$content	= $this->buildContentLogout();
		}
		return $content;
	}

	/**
	 *	Builds Log out View.
	 *	@access		protected
	 *	@return		string
	 */
	protected function buildContentLogout()
	{
		$words	= $this->words['auth']['logoutUser'];
		$button_cancel	= UI_HTML_Elements::LinkButton( "?link='javascript: history.go(-1)';", $words['button_cancel'], 'but cancel' );
		$button_logout	= UI_HTML_Elements::Button( 'logoutUser', $words['button_logout'], 'but edit' );
		$ui['field_button_cancel']	= UI_HTML_Elements::Field( '', $button_cancel );
		$ui['field_button_logout']	= UI_HTML_Elements::Field( '', $button_logout );
		$ui['text']		= $this->loadContent( 'authentication.logout.html' );
		$ui['form']		= UI_HTML_Elements::Form( 'logoutUser', "?link=logout" );
		$ui['heading']	= $words['heading'];
		$ui['caption']	= UI_HTML_Elements::TableCaption( $words['caption'] );
		$ui['colgroup']	= UI_HTML_Elements::ColumnGroup( $words['colgroup'] );
		return $this->loadTemplate( 'authentication.logout', $ui );
	}	
	
	/**
	 *	Builds Extra Panel.
	 *	@access		public
	 *	@return		string
	 */
	public function buildExtra()
	{
//		return $this->loadContent( 'purchase.market.car.extra.html' );
	}
}
?>
